// src/routes/__root.tsx
import { DownloadLink } from "@/components/DownloadLink";
import { createRootRoute } from "@tanstack/react-router";
import { Outlet, Link } from "@tanstack/react-router";
import styles from './index.module.scss';

// 根路由组件 - 应用的全局布局
export const Route = createRootRoute({
  component: () => (
    <html>
      <head>
        <meta charSet="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <title>文件路由示例</title>
      </head>
      <body>
        {/* 导航栏 */}
        <nav className="p-4 bg-gray-100">
          <Link to="/" className="mr-4">首页</Link>
          <Link to="/about" className="mr-4">关于</Link>
          <Link to="/users" className="mr-4">用户列表</Link>
        </nav>
        <DownloadLink showText="aaa" className={ styles.container} link="bbb" downloadText="ccc"/>
        {/* 子路由内容会在这里渲染 */}
        <main className="p-4">
          <Outlet />
        </main>
      </body>
    </html>
  ),
});
    